#include "BoardGrid.h"

using std::ostream;

BoardGrid::BoardGrid(void)
{
	boardChars = "123456789";
}

void BoardGrid::drawBoard ()
{
	cout << "  " << boardPosition1 << "  |  " << boardPosition2 << "  |  " << boardPosition3 << endl;
	cout << "_________________" << endl;
	cout << "  " << boardPosition4 << "  |  " << boardPosition5 << "  |  " << boardPosition6 << endl;
	cout << "_________________" << endl;
	cout << "  " << boardPosition7 << "  |  " << boardPosition8 << "  |  " << boardPosition9 << endl;
}



void BoardGrid::setBoardChar(char* _newChar, int* _boardPosition)
{
	
	for (int count = 0; count <= 9; count++)
	{
		if (boardChars[x] == _boardPosition)
		{
			if (validSelection(_boardPosition))
				boardChars[x] = _newChar;
		}
	}
}

bool BoardGrid::validSelection(int* _boardPosition)
{
	if (boardChar[_boardPosition] == "O" || "X")
	{
		throw exception("Invalid Selection");
		return false;
	}
	else
		return true;
}

BoardGrid::~BoardGrid(void)
{
}
